// 常量路由：全部用户都可以访问的路由
export const constantRoute = [
  {
    // 登录
    path: '/login',
    component: () => import('@/views/login/login.vue'),
    name: 'Login',//命名路由 权限处理
    meta: {
      title: '登录', //菜单标题
      hidden: true, //路由标题在菜单中是否隐藏
      icon: 'Promotion',//菜单左侧图标
    }
  },
  {
    // 登录成功后展示数据的路由
    path: '/',
    component: () => import('@/layout/layout.vue'),
    name: 'Layout',
    meta: {
      title: '',
      hidden: false,
      icon: '',
    },
    redirect: '/home', //访问根路径重定向到/home
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/home.vue'),
        name: 'Home',
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ]
  },
  {
    // 404
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404',
    meta: {
      title: '404',
      hidden: true,
      icon: 'DocumentDelete',
    },
  },
  // {
  //   // 大屏
  //   path: '/screen',
  //   component: () => import('@/views/screen/screen.vue'),
  //   name: 'Screen',
  //   meta:{
  //     title:'数据大屏',
  //     hidden:false,
  //     icon:'Platform',
  //   },
  // },
]

// 任意路由
export const anyRoute = {
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  name: 'Any',
  meta: {
    title: '任意路由',
    hidden: true,
    icon: 'DataLine',
  },
}

// 异步路由
export const asnycRoute = [
  // 系统管理
  {
    path: '/sys',
    component: () => import('@/layout/layout.vue'),
    name: 'SystemManage',
    meta: {
      title: '系统管理',
      icon: 'Monitor',
    },
    redirect: '/sys/student', //访问/sys重定向到/sys/student
    children: [
      {
        path: '/sys/student',
        component: () => import('@/views/sys/studentList.vue'),
        name: 'Student',
        meta: {
          title: '学生管理',
          icon: 'User',
        },
      },
      {
        path: '/sys/teacher',
        component: () => import('@/views/sys/teacherList.vue'),
        name: 'Teacher',
        meta: {
          title: '教师管理',
          icon: 'User',
        },
      },
      {
        path: '/sys/role',
        component: () => import('@/views/sys/roleList.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          icon: 'Avatar',
        },
      },
      {
        path: '/sys/menu',
        component: () => import('@/views/sys/menuList.vue'),
        name: 'Menu',
        meta: {
          title: '菜单管理',
          icon: 'Grid',
        },
      },
      {
        path: '/sys/system',
        component: () => import('@/views/sys/systemConfig.vue'),
        name: 'System',
        meta: {
          title: '系统配置',
          icon: 'Setting',
        },
      },
    ]
  },
  // 拓展管理
  {
    path: '/expand',
    component: () => import('@/layout/layout.vue'),
    name: 'ExpandManage',
    meta: {
      title: '拓展管理',
      icon: 'Tools',
    },
    redirect: '/expand/tool',
    children: [
      {
        path: '/expand/tool',
        component: () => import('@/views/expand/toolList.vue'),
        name: 'Tool',
        meta: {
          title: '类别管理',
          icon: 'List',
        },
      },
      {
        path: '/expand/info',
        component: () => import('@/views/expand/inforList.vue'),
        name: 'Information',
        meta: {
          title: '信息管理',
          icon: 'Histogram',
        },
      },
    ]
  },
  // 病例管理
  {
    path: '/case',
    component: () => import('@/layout/layout.vue'),
    name: 'CaseManage',
    meta: {
      title: '病例管理',
      icon: 'Memo',
    },
    redirect: '/case/category',
    children: [
      {
        path: '/case/category',
        component: () => import('@/views/case/categoryList.vue'),
        name: 'Category',
        meta: {
          title: '类别管理',
          icon: 'List',
        },
      },
      {
        path: '/case/caselist',
        component: () => import('@/views/case/caseList.vue'),
        name: 'CaseList',
        meta: {
          title: '病例管理',
          icon: 'Histogram',
        },
      },
    ]
  },
]

